﻿@using System.Activities.Statements
@using QDT.Core
@model QDT.Common.IPagedList<QDT.Core.Domain.UserCarry>
@section HeadSection {
    @Html.IncludeCSS("~/Content/Css/calendar.css")
    @Html.IncludeScript("~/Content/JS/calendar.js")
}
<script type="text/javascript">
    function process(userId) {
        var url = '@Url.Action("Process")' + '?id=' + userId;
        showAjaxResult(url, "会员账户", 600, 480);
    }

    function allprocess() {
        if (confirm('确定要通过所选申请吗？')) {
            var ids = [];
            $('input[name="key"]:checked').each(function () {
                ids.push($(this).val());
            });

            $.ajax({
                url: '@Url.Action("AllProcess")',
                data: {
                    carryIds: ids.join(',')
                },
                dataType: 'json',
                type: 'POST',
                success: function (result) {
                    if (result.Status && result.Status == "true") {
                        alert(result.Message);
                        location.href = location.href;
                    } else {
                        alert(result.Message);
                    }
                }
            });

        }
    }

</script>

<div class="main_title">提现申请列表</div>

<div class="blank5"></div>
<div class="search_row">
    <input type="button" class="button" value="批量处理" onclick="javascript:allprocess();" style="float: left;margin-right: 30px;"/>
	<form name="search" action="@Url.Action("Index")" method="get">	
	    会员名称：<input type="text" class="textbox" name="username" value="" style="width:100px;"/>
	    状态：<select name="status">
	           <option value="">所有</option>
	           <option value="0">未处理</option>
	           <option value="1">申请通过</option>
	           <option value="2">申请驳回</option>
	           <option value="6">提交通联</option>
	           <option value="-1">异常</option>
	       </select>
        开始日期：<input type="text" class="textbox" id="start" name="start" value="@Request.Params["start"]" onfocus=" this.blur(); return showCalendar('start', '%Y-%m-%d', false, false, 'start');" size="8"/>
	    结束日期：<input type="text" class="textbox" id="end" name="end" value="@Request.Params["end"]" onfocus=" this.blur(); return showCalendar('end', '%Y-%m-%d', false, false, 'end');" size="8"/>

        最小值：<input type="text" class="textbox" name="min" value="" style="width:100px;"/>
	    最大值：<input type="text" class="textbox" name="max" value="" style="width:100px;"/>
	    <input type="submit" class="button" value="搜索"/>
	    <a id="export_change_list" href="@Url.Action("CarryList", "Export")" class="button">导出</a>
	</form>
</div>

<div class="blank5"></div>
<div class="grid_box">
    <div class="grid_top" style="width: 100%;">
    </div>
    @Html.Grid(Model).Columns(column =>
{
    column.CheckBox(x => x.ID);
    column.For(x => x.ID).Named("编号").HeaderAttributes(style => "width:50px;align:center;");
    column.For(x => x.CreateTime).Named("申请日期");
    column.For(x => Html.ActionLink(Html.F().GetUserName(x.UserId), "Index", "User", new
    {
        userid = x.UserId
    }, "")).Named("会员名称").SortColumnName("UserId");
    column.For(x => x.RealName).Named("姓名");
    column.For(x => x.Money.ToMoney()).Named("提现金额").SortColumnName("Money");
    column.For(x => Html.F().GetBankById(x.BankId)).Named("开户行").Sortable(false);
    column.For(x => Html.F().GetRegionAddr(x.RegionLv1, x.RegionLv2, x.RegionLv3, x.RegionLv4)).Named("开户行所在地").Sortable(false);
    column.For(x => x.BankZone).Named("开户行网点").Sortable(false).HeaderAttributes(style => "width: 230px");
    column.For(x => x.BankCard).Named("银行卡卡号").Sortable(false);
    column.For(x => Html.F().GetCarryStatus(x.Status)).Named("提现状态").SortColumnName("Status");
    column.For(x => x.UpdateTime).Named("处理时间").SortColumnName("CreateTime");
    column.Buttons(btns => btns.Add(x => Html.ScriptLink("查看/处理", "process({0})", x.ID))
                                        .Add(x => Html.ActionLink("明细", "AccountDetail", "User", new { id = x.UserId }, new { target = "_blank" })));
}).Complex(ViewData)
    <div class="grid_foot">
    </div>
</div>
<div class="blank5">
</div>
@Html.Pager(Model)
